'use strict'

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    const { TEXT, INTEGER, DATE, STRING, BOOLEAN } = Sequelize
    await queryInterface.createTable('lift_record', {
      id: {
        type: INTEGER(20).UNSIGNED,
        primaryKey: true,
        autoIncrement: true,
        comment: '主键id'
      },
      title: {
        type: STRING(50),
        allowNull: false,
        comment: '标题'
      },
      content: {
        type: TEXT,
        allowNull: false,
        comment: '内容'
      },
      image: {
        type: TEXT,
        allowNull: false,
        comment: '图片'
      },
      status: {
        type: BOOLEAN,
        allowNull: false,
        defaultValue: 1,
        comment: '状态'
      },
      created_at: DATE,
      updated_at: DATE
    })
  },

  async down(queryInterface) {
    queryInterface.dropTable('lift_record')
  }
}
